Scalable font technologies that allow characters to be printed or displayed (i.e. rendered) at a variety of different sizes with great accuracy, are well known in the art. Although a number of scalable font technologies exist, TrueType developed by Apple Computers Inc. has become widely used and accepted due to its ability to offer font developers a high degree of control over precisely how fonts are rendered.
The TrueType font specification requires fonts to be stored in files that include the information necessary for the graphics processor and the operating system software to render the font characters so that font characters are displayed and/or printed as intended. TrueType font files are made up of a series of tables, some of which are mandatory (i.e. glyph tables) and some of which are optional. Glyph tables define the outlines of font characters and are made up of straight line segments and quadratic Bézier curves. For this reason, TrueType is known as an outline font format. In addition to the shapes of the font characters, TrueType font files also include tables storing information describing how font characters should be spaced vertically and horizontally within a block of text, how font characters should be mapped (i.e. the variety of characters included in the font and the keystrokes needed to access them), and more.
The user never actually sees the font character outlines stored in the font files. When a font character is to be rendered, the font character outline in the table associated therewith is scaled to the desired size through a simple mathematical operation. The graphics processor then generates a bitmap of the font character by turning on the pixels encompassed by the scaled outline, a process commonly referred to as scan conversion or rasterization.
By storing font character outlines, only one outline per font character is needed to produce all of the sizes of that font character that are required. This enables the same font character to be displayed on monitors of different resolutions, and/or to be printed at significantly differing sizes with great accuracy.
Although TrueType facilitates rendering of font characters at arbitrary sizes, issues do arise. In some cases, when a font character is scaled to a smaller size and rendered, font character information can be lost. For example, subtle features of a font character can be merged with other font character strokes or can disappear. In more severe cases, the font character can become indistinguishable from other font characters or as a font character itself. These problems are more common with Asian script characters due to their complexity. For example, FIG. 1 illustrates a complex Asian script character that has been resized without regard to font structure. As can be seen, distinction between adjacent horizontal and vertical strokes of the resized Asian script character is lost, reducing the recognizability of the script character.
When a font character is printed via a dot-matrix printer, a translation is performed between the rasterized font character and the dot pitch of the printer. Generally, a rectangle of two pixels by two pixels is represented by a single dot printed by a dot-matrix printer having a low horizontal dot-pitch resolution. In such a dot-matrix printer, the resolution in the vertical direction is typically twice the resolution in the horizontal direction. When printing the font character at the maximum speed, it is not possible for the printhead of the dot-matrix printer to strike the paper twice to print two sequential horizontal pixels due to the limited speed of the printhead. As a result, only the first pixel will result in the printhead striking the paper to print the dot. The second pixel will be ignored. For example, if a 16-pixel line is to be printed, only 8 dots will actually be printed. In the vertical direction, the print speed is much slower and thus, full resolution is possible (i.e. a dot can be printed for each pixel). As a result of this reduced resolution, in the case of complex font characters portions the complex characters, such as relatively thin diagonal strokes can appear, broken.
As mentioned above, dot sizes on a dot-matrix printer cover approximately a two pixel by two pixel area. As a result, if breaks are to appear in horizontal and vertical character strokes being printed, a spacing of at least three pixel positions between the strokes should be provided. In addition, in the case of a dot-matrix printer having a printhead comprising eight pins, with this printhead pin density, it is not possible to print horizontal dots separated by a half-dot gap. Vertical half-dot spacing is however supported under this density. As will be appreciated, the above dot-matrix printer characteristics reduce the amount of detail that can be represented in the given space.
FIGS. 2A and 2B illustrate a portion of a font character having a diagonal stroke with a horizontal width of two pixels, and its printed form using a dot-matrix printer having a horizontal dot-resolution equal to two (2). As can be seen from FIG. 2B, the diagonal stroke represented by printed dots 200A appears disjoint and broken when printed. Gaps 204A in the diagonal stroke are apparent. The gaps 204A occur due to the fact that the printhead of the dot-matrix printer strikes the paper only once when two adjacent horizontal pixels are detected.
When complex font characters are printed via thermal printers, there are different considerations. Unlike reduced resolution dot-matrix printers, the resolution of thermal printers is very similar to that of rasterized font characters. As is known, thermal printers have a row of heating elements that are activated and deactivated in order to heat the thermally-sensitive paper that is being fed along the paper path proximal to the heating elements. After the heating elements have printed the required dots along one row, they remain hot for a period of time as the paper continues to be fed through. In some cases, the cooling period is relatively long and as a result, “bleed” occurs at the bottom of each printed dot. This is especially true where the heating elements are heated for longer periods of time, such as is required during printing of vertical font character strokes. As a result, printed horizontal lines of dots tend to have a correspondingly larger width than printed vertical lines of the same thickness.
A number of solutions have been proposed for preserving font structure information. For example, U.S. Pat. No. 6,288,725 to Fu discloses a method of storing and scaling fonts. Characters are created using “composite strokes”, or combinations of strokes. Each stroke is defined using stroke identification information to identify the type of stroke, skeleton point data that identifies the skeleton of the stroke and identification information to identify characteristics of all of the tips in a stroke. In order to reproduce a character, each stroke of the character is regenerated separately. A separate non-linear scaling coefficient table for each stroke allows for preservation of the stroke shape during scaling. The skeleton point data is used in conjunction with the stroke identification information to map out the main portion of the stroke. The identification information for each stroke tip is then used to customize the stroke. Other stroke shape control coefficients can be adjusted to further customize the stroke.
U.S. Pat. No. 6,157,750 to Choi et al. discloses a method of transforming and rendering a character using the outline shapes of characters. By using an outline of a basic character, the medial axes, radii of maximal inscribed circles and corresponding contact points of the circles with the outline, are determined. This information is stored and used to scale and/or reproduce the character.
U.S. Pat. No. 6,356,278 to Stamm et al. discloses a method and system for displaying images on a flat panel display device, such as a liquid crystal display. During display of a character, the origin point of the character is positioned at a fractional position of a pixel grid, and is then overscaled (stretched). The overscaling allows for the character to occupy whole number pixel positions instead of fractional pixel positions along a striping direction of the display device. The character is then supersampled. The supersampling allows for samples to be mapped individually to pixel subcomponents (i.e. red, blue and green). As a result, characters can have their origin at pixel subcomponent positions (one of red, green or blue) rather than only at whole pixel positions, which allows for an increase in the resolution of the display device.
U.S. Patent Application Publication No. 2004/0006749 to Fux et al. discloses a method and system for creating font format data based on source font data. Font format data of text may be stored as a stroke font that is defined by a skeleton of characters, or glyphs, in a font. The skeleton comprises elements that may be common with other glyphs, or unique to a certain glyph. Description data of the glyph includes shape data, coordinate shifting and a scaling factor for given shapes so that the glyph can be constructed from its component strokes. A rendering engine then applies style, thickness and other characteristics of a typeface. To generate font format data, a source font undergoes glyph dissection, midline extraction, element analysis and conversion. Glyph dissection begins with contour analysis, whereby points are located along the outline of the source glyph. The located points are analyzed and connected in order to form contours. Strokes are then generated to represent the glyph and the strokes are merged. Midline extraction is performed by comparing points on one stroke to their nearest point on another stroke. By repeating this process over multiple points, the midline is extracted. The combination of midlines of the glyph makes up the skeleton.
Although the above references disclose various methods of preserving font structure, improvements in the preservation of font structure are desired. It is therefore an object of the present invention to provide a novel method and apparatus for preserving the structure of a font character being scaled.